Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Getting and Playing Movies / Saving Movies


AddMovieResource

The AddMovieResource function adds a movie resource to a specified resource file. Your application identifies the movie to be added to the movie file.

pascal OSErr AddMovieResource (Movie theMovie, short resRefNum, 
                                 short *resId, 
                                 const StringPtr resName);
theMovie
Specifies the movie you wish to add to the movie file. Your application obtains this movie identifier from such functions as NewMovie, NewMovieFromFile, and NewMovieFromHandle (described on page 2-80, page 2-76, and page 2-78, respectively).
resRefNum
Identifies the movie file to which the resource is to be added. Your application obtains this value from the OpenMovieFile function, described on page 2-86. The movie file specified by this parameter cannot be a single-fork movie file.
resId
Contains a pointer to a field that contains the resource ID number for the new resource. If the field referred to by the resId parameter is set to 0, the Movie Toolbox assigns a unique resource ID number to the new resource. The toolbox then returns the movie's resource ID number in the field referred to by the resId parameter. The AddMovieResource function assigns resource ID numbers sequentially, starting at 128. If the resId parameter is set to nil, the Movie Toolbox assigns a unique resource ID number to the new resource and does not return
that resource's ID value.
resName
Points to a character string that contains the name of the movie resource. If you set the resName parameter to nil, the toolbox creates an unnamed resource.
DESCRIPTION
The AddMovieResource function adds the movie to the file, effectively saving any changes you have made to the movie. This function does not work with single-fork movie files.

After updating the movie file, AddMovieResource clears the movie changed flag, indicating that the movie has not been changed.

ERROR CODES
invalidMovie-2010This movie is corrupted or invalid
File Manager errors
Memory Manager errors
Resource Manager errors


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996